# -*-coding:utf-8-*-
'''
File Create by Author:Backpackerxl
Create File Time:2021/10/13/013 21:00
Program IDE:PyCharm
File Name:MangerDao.py
  
'''
from entity.Root import Root
from util.File import File

root = File("./data/root.json").get_all_data()


class MangerDao:
    def login(self, user):
        res = [u_item for u_item in root if user == u_item["user_name"]]
        manger = None
        if len(res) != 0:
            manger = Root(res[0]["user_name"], res[0]["user_password"])

        return manger
